package com.eduhzy.ttw.commonsdk.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.chad.library.adapter.base.entity.MultiItemEntity;

/**
 * @author xubo
 * @date 2018/8/1 15:03
 */
public class MyCourseData  implements MultiItemEntity, Parcelable {

    private int itemType = 1;
    /**
     * internalId : 99765
     * preImage : http://192.168.0.110:8081/res//u/cms/www/201808/27172715czk3.jpg
     * color : 0
     * playInfo : 已播出
     * todayHasDirect : false
     * shopName : 堂堂网自营
     * shopId : 1
     * title : 测试用例
     */

    private int internalId;
    private String preImage;
    private int color;
    private String playInfo;
    private boolean todayHasDirect;
    private String shopName;
    private int shopId;
    private String title;

    public MyCourseData setItemType(int itemType) {
        this.itemType = itemType;
        return this;
    }

    @Override
    public int getItemType() {
        return itemType;
    }

    public int getInternalId() {
        return internalId;
    }

    public void setInternalId(int internalId) {
        this.internalId = internalId;
    }

    public String getPreImage() {
        return preImage;
    }

    public void setPreImage(String preImage) {
        this.preImage = preImage;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public String getPlayInfo() {
        return playInfo;
    }

    public void setPlayInfo(String playInfo) {
        this.playInfo = playInfo;
    }

    public boolean isTodayHasDirect() {
        return todayHasDirect;
    }

    public void setTodayHasDirect(boolean todayHasDirect) {
        this.todayHasDirect = todayHasDirect;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public int getShopId() {
        return shopId;
    }

    public void setShopId(int shopId) {
        this.shopId = shopId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.itemType);
        dest.writeInt(this.internalId);
        dest.writeString(this.preImage);
        dest.writeInt(this.color);
        dest.writeString(this.playInfo);
        dest.writeByte(this.todayHasDirect ? (byte) 1 : (byte) 0);
        dest.writeString(this.shopName);
        dest.writeInt(this.shopId);
        dest.writeString(this.title);
    }

    public MyCourseData() {
    }

    protected MyCourseData(Parcel in) {
        this.itemType = in.readInt();
        this.internalId = in.readInt();
        this.preImage = in.readString();
        this.color = in.readInt();
        this.playInfo = in.readString();
        this.todayHasDirect = in.readByte() != 0;
        this.shopName = in.readString();
        this.shopId = in.readInt();
        this.title = in.readString();
    }

    public static final Parcelable.Creator<MyCourseData> CREATOR = new Parcelable.Creator<MyCourseData>() {
        @Override
        public MyCourseData createFromParcel(Parcel source) {
            return new MyCourseData(source);
        }

        @Override
        public MyCourseData[] newArray(int size) {
            return new MyCourseData[size];
        }
    };
}
